﻿using Autofac;
using BusinessRepository.sqlserver;
using ce.autofac.extension;
using System;
using System.Collections.Generic;
using System.Text;

namespace BusinessRepository
{
    public class DbRegister
    {

        /// <summary>
        /// 注册数据库实现类
        /// </summary>
        /// <param name="builder">服务构建器</param>
        /// <returns>服务构建器</returns>
        public static void Register(ContainerBuilder builder)
        {
            // 注册各个数据库实现
            builder.RegisterType(typeof(SqlserverDataBase)).As(typeof(IDataBase)).Named<IDataBase>("SqlServer").InstancePerDependency();


           
            //builder.RegisterType(typeof(OracleDataBase)).As(typeof(IDataBase)).Named<IDataBase>("Oracle");
            //builder.RegisterType(typeof(MySqlDataBase)).As(typeof(IDataBase)).Named<IDataBase>("MySql");
        }
    }
}
